		<div id="sidebar">
			<div class="mid_content ranklist">
				<h1>
				  <a href="" title="写作排行榜">写作排行榜</a>
				</h1>
					<ul>
<?php
$sql="SELECT * FROM ".tbname('essay')." WHERE `essay_categoryid` BETWEEN 222 AND 229 OR `essay_categoryid`=250 OR `essay_categoryid` BETWEEN 253 AND 258 ORDER BY `essay_click` DESC LIMIT 0,7";
$res=mysql_query($sql);
while($row=mysql_fetch_array($res)){
    $essayid=$row['essay_id'];
	$author=$row['essay_author'];
    $title=$row['essay_title'];
    $click=$row['essay_click'];

?>
						<li><a href="./?view-<?=$essayid?>.htm" title=""><?=utf8Substr($title,'0','40')?> <?=utf8Substr($author,'0','10')?> <?=$click?></a></li>
<?php } ?>
					</ul>
			</div>
			<div class="mid_content img_say">
				<h1>
				  <a href="./?class-<?=getinfo(250,'englishname','categories')?>.htm" title="图说故事">图说故事</a>
				</h1>
				<ul>
<?php
$sqlimg="SELECT * FROM ".tbname('essay')." WHERE  `essay_status`='pub' AND `essay_categoryid`=250 ORDER BY `essay_updatetime` DESC LIMIT 0,8";
$resimg=mysql_query($sqlimg);
while($row=mysql_fetch_array($resimg)){
    $essayid=$row['essay_id'];
    $title=$row['essay_title'];
    $content=$row['essay_content'];

?>
					<li>
						<a href="./?view-<?=$essayid?>.htm" title="<?=utf8Substr($title,'0','25')?>"><img src="../youngth/<?=getinfobywhere('attachment','path',"attachment_essayid=$essayid")?>" alt="<?=utf8Substr($title,'0','25')?>" /></a>
						<span><a href="./?view-<?=$essayid?>.htm" title="<?=utf8Substr($title,'0','25')?>"><?=utf8Substr($title,'0','20')?></a></span>
					</li>
<?php } ?>
			</div>
		</div>
